
<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="E:\git\muggle\blog\static\js\reqwest.js"></script>
    <script src="E:\git\muggle\blog\static\js\vue1.js"></script>
</head>
<body id="app">
    <button v-on:click="getDate" class="ui red button">获取数据</button>
    

    <script type="text/javascript">
        var vm = new Vue({
            el:"#app",
            data:{
                test:[]
            },
            methods:{
                getDate:function () {
                    var self = this;
                    reqwest:({
                        url:'http://swapi.co/api/people/?format=json',
                        type:'json',
                        method:'get',
                        success:function(resp) {
                            console.log(resp);
                            resp = self.test;
                        },
                        error: function(resp){
                            console.log(resp);
                        }
                    })
                }
            },
        })
    </script>
</body>
</html>